<%-- 
    Document   : pertanyaan_tawaran_haji
    Created on : Aug 9, 2012, 9:31:25 AM
    Author     : faizal.azlee(Theta-Edge Bhd)
--%>
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Pendaftaran Haji</title>
        <script type="text/javascript">        
        $(document).ready(function(){
            $('form').submit( function () {
                return formValidation();
            });           
        });

        
        function validate(f)
        {
            var ret = validate1();
            if(ret)
            {
                if(document.getElementById("bandar").value=="")
                {
                    alert("Sila pilih Tempat Lahir");
                    return false;
                }
                else if(document.getElementById("status").value=="")
                {
                    alert("Sila pilih Pekerjaan");
                    return false;
                }
                else
                {
                    f.action = "${pageContext.request.contextPath}/haji/registration?HajjReg_Step4";
                    f.submit();
                }
            }
            else
                return false;
        }
        function validate1()
        {
            if(!validate_notel1() && !validate_notel2() && !validate_notel3())
            {
                alert("Salah satu no telefon mesti dimasukkan");
                return false;
            }
            return true;
        }
        function validate_notel1()
        {     
            if(document.getElementById("noTel1").value.trim().length>0)
            {                 
                return true;
            } 
            return false;
        }
        function validate_notel2()
        {
            if(document.getElementById("noTel2").value.trim().length>0 )
            { 
                return true;
            }   
            return false;
        }
        function validate_notel3()
        {
            if(document.getElementById("noTel3").value.trim().length>0 )
            { 
               return true;
            }   
            return false;
        }
        function regextest(evt){
            var theEvent = evt || window.event;
            var key = theEvent.keyCode || theEvent.which;
            key = String.fromCharCode( key );                
            var regex = /^[0-9]+$/;
            if( !regex.test(key) ) {
              theEvent.returnValue = false;
              if(theEvent.preventDefault) theEvent.preventDefault();
            }
        }
        </script>
    </head>
    <body>
        <s:messages/>
        <s:errors/> 
        <br/>
        <s:useActionBean beanclass="th.stripes.util.ListUtil" id="listUtil" />
        <s:form beanclass="th.stripes.action.HajiRegistrationActionBean">
            
            <s:hidden name="haji.noAkaun"/>
            <s:hidden name="haji.noKp"/>
            <s:hidden name="haji.nama"/>
            <s:hidden name="haji.noTel1"/>
            <s:hidden name="haji.noTel2"/>
            <s:hidden name="haji.noTel3"/>
            <s:hidden name="haji.nofax"/>
            <s:hidden name="haji.alamat1"/>
            <s:hidden name="haji.alamat2"/>
            <s:hidden name="haji.alamat3"/>
            <s:hidden name="haji.alamat3"/>
            <s:hidden name="haji.poskod"/>
            <s:hidden name="haji.negeri.code"/>
            <s:hidden name="haji.noTel3" id="noTel3"/>
             
            <div id="content">
            <div id="logo">
                <span>
                    <img src="${pageContext.request.contextPath}/images/img/ribbon.png"/>               
                </span>
            </div> 
                <h3>
                    Pendaftaran Haji
                </h3>
                <p>
                        <label>No. Akaun TH :</label> ${actionBean.haji.noAkaun}                                              
                </p>
                <p>
                        <label>No. KP Semasa :</label> ${actionBean.haji.noKp}                                            
                </p>
                <p>
                        <label>Nama :</label> ${actionBean.haji.nama}
                </p>
                <p  style="height: 15px;">
                    <label>Alamat :</label>${actionBean.haji.alamat1}        
                </p>
                <p style="height: 15px;">
                    <label>&nbsp; </label>${actionBean.haji.alamat2}         
                </p>
                <p style="height: 15px;">
                    <label>&nbsp; </label>${actionBean.haji.alamat3}         
                </p>
                <p>
                    <label>Poskod :</label>${actionBean.haji.poskod}&nbsp;&nbsp;${actionBean.haji.poskodDeskripsi}         
                </p>
                <p>
                        <label>Negeri :</label> ${actionBean.haji.negeri.desc}
                </p>  
                <p>
                    <label><font color="red">*</font>No Telefon&nbsp;&nbsp;</label><br>                        
                </p>
                <p style="height: 25px;">
                    <label>Rumah :</label>
                        <s:text name="haji.noTel1" id="noTel1" maxlength="12" onkeypress='regextest(event)'/>&nbsp;
                </p>
                <p style="height: 25px;">
                    <label>Pejabat :</label>
                        <s:text name="haji.noTel2" id="noTel2" maxlength="12" onkeypress='regextest(event)'/>&nbsp;
                </p>
                <p style="height: 25px;">
                    <label>Bimbit :</label>
                        ${actionBean.haji.noTel3}&nbsp;
                </p> 
                <p>
                        <label><font size="0">Sila isi salah satu no. telefon</font></label>
                </p>
                <br>
                <p>
                        <label>No. fax :</label>
                        <s:text name="haji.fax" id="nofax"/>&nbsp;
                </p>
                <p>
                        <label>Tempat Lahir :</label>

                                <s:select name="haji.bandar.kod" id="bandar">
                                        <s:option value="">Sila Pilih</s:option>
                                        <c:forEach items="${listUtil.senaraiBandar}" var="item">
                                        <s:option value="${item.kod}">${item.kod} - ${item.nama}</s:option>
                                </c:forEach>                                                             
                                </s:select>
                </p>
                <p>
                    <label>Pekerjaan :</label>

                                <s:select name="haji.sektorPekerjaan.kod" id="status">
                                        <s:option value="">Sila Pilih</s:option>
                                        <c:forEach items="${listUtil.senaraiSektorPekerjaan}" var="item">
                                        <s:option value="${item.kod}">${item.kod} - ${item.nama}</s:option>
                                </c:forEach>
                                </s:select>
                </p>
                <br>
                <p>
                    <font size="2"> Nota : Untuk Kemaskini Alamat Sila Ke Menu Deposit > Kemaskini Profil atau Hubungi <i><b>THCC</b></i> Di Talian 03-62071919.
                    </font>
                </p>                                                
                <p align="center">                    
                    <s:button name="simpan" value="Simpan" class="button green" onclick="validate(this.form)"/>
                </p>
            </div>
        </s:form>
    </body>
</html>
